import http from './http';

// 创建支付订单
export const createOrderApi = (data) => {
  return http({
    method: 'post',
    url: '/payment/createOrder',
    data
  });
};

// 查询订单状态
export const queryOrderStatusApi = (orderNo) => {
  return http({
    method: 'get',
    url: `/payment/orderStatus/${orderNo}`
  });
};

// 取消订单
export const cancelOrderApi = (orderNo) => {
  return http({
    method: 'post',
    url: `/payment/cancelOrder/${orderNo}`
  });
};

// 获取支付记录
export const getPaymentRecordsApi = () => {
  return http({
    method: 'get',
    url: '/payment/records'
  });
};

// 获取套餐信息
export const getPackagesApi = () => {
  return http({
    method: 'get',
    url: '/popup/packages'
  });
};

// 检查用户是否已购买19.9特殊套餐
export const checkSpecialPackageApi = () => {
  return http({
    method: 'get',
    url: '/payment/checkSpecialPackage'
  });
};